﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:SoGame.Controls"
                    xmlns:SoGame="clr-namespace:SoGame">

    <Style x:Key="MetroWindow" TargetType="{x:Type Window}">
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="FontSize" Value="{StaticResource NormalTextSize}" />
        <Setter Property="Foreground" Value="{DynamicResource MetroText}"/>
        <Setter Property="UseLayoutRounding" Value="True" />
        <Setter Property="Foreground" Value="{DynamicResource MetroText}" />
        <Setter Property="BorderBrush" Value="{DynamicResource MetroLineBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <!--<Setter Property="Icon" Value="/SoGame;component/SoGame.ico" />-->
        <Setter Property="WindowStyle" Value="None" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:BorderLessWindow}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <AdornerDecorator>

                            <Grid>

                                <Grid x:Name="PART_HeaderPanel" Height="40" DockPanel.Dock="Top" Background="Transparent" VerticalAlignment="Top">

                                </Grid>


                                <ContentPresenter Margin="0,0,0,0"/>


                                <Grid  Height="40" DockPanel.Dock="Top" VerticalAlignment="Top">

                                    <StackPanel HorizontalAlignment="Right" Margin="0,0,6,0" Orientation="Horizontal">

                                        <StackPanel x:Name="PART_WindowControls" Orientation="Horizontal" VerticalAlignment="Top">
                                            <Button Focusable="False" x:Name="PART_MinimiseButton" Style="{DynamicResource MetroPathButton}" Width="19" Height="23" ToolTip="Minimiser" Command="{TemplateBinding MinimiseCommand}">
                                                <Rectangle Width="7" Height="2" Fill="{DynamicResource MetroHeadingColorDark}" VerticalAlignment="Bottom" Margin="0,6,0,4" />
                                            </Button>
                                            <Button Focusable="False"  x:Name="PART_MaximiseBtn" Style="{DynamicResource MetroPathButton}" Width="19" Height="23" ToolTip="Maximiser" Command="{TemplateBinding MaximiseCommand}">
                                                <Path Fill="{DynamicResource MetroHeadingColorDark}" Data="{StaticResource PathMaximize}" Margin="0,6,0,0" Width="9" Height="9" Stretch="Fill" />
                                            </Button>
                                            <Button Focusable="False" x:Name="PART_RestoreBtn" Style="{DynamicResource MetroPathButton}" Width="19" Height="23" ToolTip="Restaurer" Visibility="Collapsed" Command="{TemplateBinding MaximiseCommand}">
                                                <Path Fill="{DynamicResource MetroHeadingColorDark}" Data="{StaticResource PathRestore}" Margin="0,6,0,0" Width="9" Height="9" Stretch="Fill" />
                                            </Button>
                                            <Button Focusable="False" x:Name="PART_CloseBtn" Width="19" Height="23" Style="{DynamicResource MetroPathButton}" ToolTip="Quitter" Command="{TemplateBinding ExitCommand}">
                                                <Path Fill="{DynamicResource MetroHeadingColorDark}" Data="{StaticResource PathClose}" Margin="0,6,0,0" Stretch="Fill" Width="9" Height="9" />
                                            </Button>
                                            <Button Focusable="False" x:Name="PART_CloseBtnMax" Width="25" Height="23" Margin="0,0,-6,0" Style="{DynamicResource MetroPathButton}" ToolTip="Quitter" Visibility="Collapsed" Command="{TemplateBinding ExitCommand}">
                                                <Path Fill="{DynamicResource MetroHeadingColorDark}" Data="{StaticResource PathClose}" Margin="0,6,6,0" Stretch="Fill" Width="9" Height="9" />
                                            </Button>

                                        </StackPanel>
                                    </StackPanel>

                                </Grid>



                                <ResizeGrip x:Name="PART_FormResizeGrip"      HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="Transparent" Focusable="false" Cursor="SizeNWSE" Panel.ZIndex="5" />
                                <Rectangle  x:Name="PART_LeftResizeRect"  HorizontalAlignment="Left" Margin="0,5" Width="5" Cursor="SizeWE" Panel.ZIndex="5" Fill="Transparent" />
                                <Rectangle  x:Name="PART_RightResizeRect"  HorizontalAlignment="Right" Width="5" Cursor="SizeWE" Panel.ZIndex="5" Margin="0,5,0,10" Fill="Transparent" />
                                <Rectangle  x:Name="PART_BottomResizeRect"   VerticalAlignment="Bottom" Height="5" Margin="5,0,10,0" Cursor="SizeNS" Panel.ZIndex="5" Fill="Transparent" />
                                <Rectangle  x:Name="PART_TopResizeRect" VerticalAlignment="Top" Height="5" Margin="5,0" Cursor="SizeNS" Panel.ZIndex="5" Fill="Transparent" />
                                <Rectangle  x:Name="PART_TopLeftResizeRect"  VerticalAlignment="Top" Height="5" Margin="0" Width="5" HorizontalAlignment="Left" Cursor="SizeNWSE" Panel.ZIndex="5" Fill="Transparent" />
                                <Rectangle  x:Name="PART_TopRightResizeRect"  VerticalAlignment="Top" Height="5" Margin="0" Width="5" HorizontalAlignment="Right" Cursor="SizeNESW" Panel.ZIndex="5" Fill="Transparent" />
                                <Rectangle  x:Name="PART_BottomLeftResizeRect"  VerticalAlignment="Bottom" Height="5" Margin="0" Width="5" HorizontalAlignment="Left" Cursor="SizeNESW" Panel.ZIndex="5" Fill="Transparent" />

                            </Grid>

                        </AdornerDecorator>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DialogBoxBase" TargetType="{x:Type Controls:DialogBoxBase}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="12" />
        <Setter Property="UseLayoutRounding" Value="True" />
        <Setter Property="Background" Value="{DynamicResource MetroPopupBg}" />
        <Setter Property="Foreground" Value="{DynamicResource MetroText}" />
        <Setter Property="BorderBrush" Value="{DynamicResource MetroLineBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Padding" Value="100,1" />
        <Setter Property="BorderThickness" Value="0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:DialogBoxBase}">
                    <Grid>
                        <Rectangle>
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{DynamicResource MetroWindowOverlay}" />
                            </Rectangle.Fill>
                        </Rectangle>
                        <Grid Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10"/>
                                <ColumnDefinition Width="Auto" MinWidth="300"/>
                                <ColumnDefinition Width="10"/>
                            </Grid.ColumnDefinitions>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{TemplateBinding Background}" Grid.Column="1">
                                <AdornerDecorator>
                                    <ContentPresenter Margin="20"/>
                                </AdornerDecorator>
                            </Border>
                            <Rectangle Opacity="0.25">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                        <GradientStop Color="#00000000" Offset="0"/>
                                        <GradientStop Color="Black" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Opacity="0.25" Grid.Column="2">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0,0" StartPoint="1,0">
                                        <GradientStop Color="#00000000" Offset="0"/>
                                        <GradientStop Color="Black" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>